<?php
/*
	
*/
defined('BY_JYA') or exit('Access Denied');
global $_RQ,$_AR;

$_RQ['op']=$_RQ['op']?$_RQ['op']:'main';
$return=array();
$return['diy']=$this->plugin_setting('diy');
$basic=$this->plugin_setting('basic');
$return['basic']=$basic;
if($_RQ['op']=='main'){
	$this->model('order')->check_level();
	$uniacid = $_SESSION['uniacid'];
	$id = intval($_RQ['id']);
	$groupid = intval($_RQ['groupid']);
	$mid = $_SESSION['uid'];
	if (empty($id)) 
	{
		exi('你访问的商品不存在或已删除!','error');
	}
	$group=pdo_get('jy_aligroup_groups',array('id'=>$groupid,'uniacid'=>$uniacid,'status'=>1));
	$goods=pdo_get('jy_weishop_goods',array('id'=>$id,'uniacid'=>$_SESSION['uniacid']));
	$goods['fightnum'] = pdo_count('jy_aligroup_groups_order',array('goodsid' => $goods['id'], 'uniacid'=>$_SESSION['uniacid'],'is_team' => 1, 'status >' => 0),'id');
	$goods['fightnum'] = $group['teamnum'] + $goods['fightnum'];
	if($group['agio']!=0){
			$goods['groupsprice'] = $group['agio']*$goods['price']/100;
	}else{
			$goods['groupsprice'] =$goods['price'];
	}
	$return['list']=array();
	$return['goods']=$goods;
	$return['group']=$group;
	$return['member']=$member;
	$return['times']=$times;
	exi($return);
}